import React, { Component } from "react";
import ReactDOM from 'react-dom/client';
import HomePage from "./HomePage";
import RoomJoinPage from "./RoomJoinPage";
import CreateRoomPage from "./CreateRoomPage";
import { BrowserRouter as Router, Route, Routes } from "react-router-dom";
import Room from './Room'

export default class App extends Component {
  constructor(props) {
    super(props);
  }

  render() {
    return (
      <Router basename="/frontend">
        <Routes>
          <Route path="/" element={<HomePage />} />
          <Route path="/join" element={<RoomJoinPage />} />
          <Route path="/create" element={<CreateRoomPage />} />
          <Route path="/room/:roomCode" element={<Room />} />
          {/* 其他路由配置 */}
        </Routes>
      </Router>
    );
  }
}

const root = ReactDOM.createRoot(document.getElementById('app'));
root.render(<App />);